this.main=function(){
var mainwidth=frame_center.getInnerWidth() - 4;
var mainheight=frame_center.getInnerHeight();
var sm = new Ext.grid.CheckboxSelectionModel({
				singleSelect : false
			});
		var cm =getusercolumn(sm);
		var dataRecord = Ext.data.Record.create([
			{name : 'userid',	type : 'int'},
			{name : 'usercode',	type : 'string'},
			{name : 'username',	type : 'string'},
			{name : 'statemark',	type : 'string'},
			{name : 'loginmark',	type : 'string'},
			{name : 'createuser',	type : 'int'},
			{name : 'createusername',	type : 'string'},
			{name : 'createtime',	type : 'string'},
			{name : 'usertype',	type : 'string'}
		]);
		
		var formobj=getPageForm();
		formobj.frame =true;
		formobj.border =false;
		formobj.collapsible =true;
		formobj.title=" ";
		formobj.animCollapse=false;
		formobj.animate =false;
		formobj.collapseMode ='mini';
		formobj.collapsed=true;
		formobj.region ='east';
		formobj.padding =6;
		formobj.width =420;
     var formPanel=new Ext.form.FormPanel(formobj);
     var store = new Ext.data.Store({
			 autoLoad : {
					params : {
						start : 0,
						limit : 30
					}
				},
				proxy : new Ext.data.HttpProxy({
						url : basepath+'../sysControl/permission/UserController/queryPage.do'

						}),
				reader : new Ext.data.JsonReader({
							totalProperty : 'results',
							root : "items",
							id : 'userid'
						}, dataRecord)
			});

var pagingBar = new Ext.PagingToolbar({// 分页工具栏
		store : store,
		pageSize : 30,// 每页显示的条数。用于系统自动计算它的start值
		displayInfo : true,
		displayMsg : '数据从第{0}条 - 第{1} 条 共 {2}条数据',
		emptyMsg : "没有记录"

	});
	var grid = new Ext.ux.grid.LockingGridPanel({
		cm : cm,
		sm : sm,
		region : 'center',
		store : store,
		border: false,
		bbar : pagingBar
	});
var userForGroupPanel=getUserForGroupPanel(mainwidth-300);
grid.addListener('rowclick', function(grid, rowindex, e){
	var userid=store.getAt(rowindex).data.userid;

var store1=userForGroupPanel.get(0).getStore();
	store1.baseParams.userid=userid;
	store1.load();
var store2=userForGroupPanel.get(2).getStore();
	store2.baseParams.userid=userid;
	store2.load();
}); 

var displayPanel = new Ext.Panel({
		width    : mainwidth,
		height   : mainheight,
		layout   : 'border',
        renderTo:'divLlist'+this.menuid,
		items    : [
		{xtype:'panel',border: false,region : 'center',layout   : 'border',items:[grid,userForGroupPanel]},formPanel
		],
		tbar : [
			{text:'添加'	,
			iconCls : 'table_add',
			handler:function(){
					formPanel.setTitle("添加用户");
					formPanel.expand();
					formPanel.getForm().reset();
					formPanel.submitUrl=basepath+"../sysControl/permission/UserController/add.do";
//					treeLoader.baseParams['groupid'] = null;
					//tree.root.reload();
				}
			},
			{text:'修改'	,
			iconCls : 'table_edit',
			handler:function(){
				var record = grid.getSelectionModel().getSelections();
						  			if (record.length <= 0) {
										Ext.MessageBox.alert('提示', '请选择需要修改的记录');
										return ;
									} else if (record.length > 1) {
										Ext.MessageBox.alert('提示', '最多只能选择一行记录');
											return ;
								    }
					
					    formPanel.submitUrl=basepath+"../sysControl/permission/UserController/update.do";
					    formPanel.setTitle("修改用户");
					    formPanel.expand();
						formPanel.getForm().setValues(record[0].data);

					}
			},
			{text:'保存'	,
			iconCls : 'table_save',
			handler:function(){
				
				
						var isNotAlert=false;
						if(!formPanel.collapsed){
							submitFormPanel(formPanel,formPanel.submitUrl, function(form,action){
										   			Ext.Msg.alert("提示",action.result.info);
										   				store.reload();
							});
							isNotAlert=true;
						}else{
							var store1=userForGroupPanel.get(0).getStore();

							if(store1.baseParams.userid==null)
								return;
							var ids="userid="+store1.baseParams.userid;
					        for(var i=0;i<store1.getCount();i++){
					        	ids+="&groupid="+store1.getAt(i).get('groupid');
					        }
						deleteData(basepath+"../sysControl/permission/UserController/insertGroup.do", ids,null,false,isNotAlert);
						}
					}
			},
			{text : '删除',
				iconCls : 'table_delete',
				handler : function() {
					var rs = grid.getSelectionModel().getSelections();
			        if(!rs||rs.length<=0){
			        Ext.Msg.alert("提示","请选择可用需要删除的记录");
			        return;
			        }
			        
			        var ids="";
			        for(var i=0;i<rs.length;i++){
			        	if(i!=0)
			        		ids+="&";
			        	ids+="ids="+rs[i].data.userid;
			        }
			        		function removeGroup(){
			         			userForGroupPanel.get(0).getStore().removeAll();
								userForGroupPanel.get(2).getStore().removeAll();
			        		}
			        deleteData(basepath+"../sysControl/permission/UserController/delete.do",
					        ids,store,
					        '你确定要删除选择的选择的角色组吗？',false,removeGroup);
					       
				}},'->',{
			text : '导出excel',
			iconCls : 'page_excel',
			handler: function(){
			grid.outExcelXml(false,'用户列表');
			}
		},closebtn
		]
	});
	var username = new Ext.form.TextField({name:'username'});
	var usercode = new Ext.form.TextField({name:'usercode'});

			var tbar2 = new Ext.Toolbar({
				renderTo : displayPanel.tbar,
				items : ['用户名',username,'用户登陆名',usercode,
						{ text:'查询',iconCls:'table_find',tooltip : '查询',
					  	handler : function() {
					  			addStoreBaseParams(username,'username',store);
					  			addStoreBaseParams(usercode,'usercode',store);
								store.load({params:{start:0,limit:30}});
						}
				}]
			});
	
	destroyResize(displayPanel,[tbar2]);
}